<template>
	<view>
		<view class="" style="padding-bottom: 30rpx;">
			<view class="topbgc"></view>
			<view class="" style="position: relative;z-index: 100;">
				<view class="flexbetween mainpadding" style="padding-top: 80rpx;" v-if="!is_login" @click="login()">
					<view class="flexleft">
						<image src="@/static/images/system/weidenglu.png" class="headimg margin_right" mode=""></image>
						<view class="sanshier xiaohei bold">未登录，点击去登录</view>
					</view>
					<u-icon name="arrow-right" color="#999" size="24"></u-icon>
				</view>
				<view class="flexbetween mainpadding" style="padding-top: 80rpx;" v-if="is_login"
					@click="jumpurl('/pages_mypage/gerenxinxi')">
					<view class="flexleft">
						<image :src="userInfo.avatar_text" class="headimg margin_right" mode=""></image>
						<view class="flexcolumnbet" style="height: 100rpx;">
							<view class="sanshier xiaohei bold">{{userInfo.username}}</view>
							<view class="xiaohei main_size">{{userInfo.mobile}}</view>
						</view>
					</view>
					<u-icon name="arrow-right" color="#999" size="24"></u-icon>
				</view>
				<view class="mainpadding">
					<view class="jfbgc flexbetween" @click="jumpurl('/pages_mypage/wodejifen')">
						<view class="">
							<view class="sanshier xiaobai">账户积分（个）</view>
							<view class=" xiaobai bold margin_top2" style="font-size: 50rpx;">{{userInfo.score || "0"}}
							</view>
						</view>
						<view class="chakan titletext xiaobai">查看</view>
					</view>
				</view>
				
			</view>
			<view class="mainpadding2">
				<view class="mainpadding ffffff radius">
					<view class="flexbetween xiahuaxian" @click="jumpurl('/pages_mypage/quanbudingd')">
						<view class="flexleft">
							<image src="@/static/images/system/qbdd.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">全部订单</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
					<view class="flexbetween xiahuaxian margin_top4" @click="jumpurl('/pages_mypage/jifendd')">
						<view class="flexleft">
							<image src="@/static/images/system/my1.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">积分订单</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
					<view class="flexbetween margin_top4 xiahuaxian" v-if="userInfo.sjtype==1" @click="jumpurl('/pages_mypage/wodebaozhengj')">
						<view class="flexleft">
							<image src="@/static/images/system/my2.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">我的保证金</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
					<view class="flexbetween margin_top4 xiahuaxian" v-if="userInfo.usertype==2"
						@click="jumpurl('/pages_mypage/renwuguanl')">
						<view class="flexleft">
							<image src="@/static/images/system/my3.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">任务管理</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
					<view class="flexbetween margin_top4 xiahuaxian" @click="jumpurl('/pages_mypage/tianjiachel')">
						<view class="flexleft">
							<image src="@/static/images/system/my4.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">我的车辆</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
					<view class="flexbetween margin_top4 xiahuaxian" @click="saoma">
						<view class="flexleft">
							<image src="@/static/images/system/my5.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">扫码核销</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
					<view class="flexbetween margin_top4 xiahuaxian" @click="jumpurl('/pages_mypage/hexiaojl')">
						<view class="flexleft">
							<image src="@/static/images/system/my6.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">核销记录</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
					<view class="flexbetween margin_top4" @click="jumpurl('/pages_mypage/shezhi')">
						<view class="flexleft">
							<image src="@/static/images/system/my7.png" class="lefticon margin_right2" mode=""></image>
							<view class="titletext hei_text ">设置</view>
						</view>
						<u-icon name="arrow-right" color="#999" size="20"></u-icon>
					</view>
				</view>
			</view>
			<view class="textcenter xiaohui main_size">陕西康特文汽车服务有限公司 版权所有</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				is_login: false,
				userInfo: {},
				show: false,
				title: '确定要退出当前账户么？',
			}
		},
		onShow() {
			this.is_login = httpRequest.checkIsLogin();
			if (this.is_login) {
				this.init()
			} else {
				this.userInfo = {}
			}
		},
		methods: {
			saoma() {
				let that = this
				uni.scanCode({
					success: function(res) {
						console.log('条码类型：' + res.scanType);
						console.log('条码内容：' + res.result);
						that.jumpdetail('/pages_mypage/hexiao?id=', res.result)
					}
				});
			},
			init() {
				httpRequest.request('/api/user/index', 'GET', {}).then(res => {
					this.userInfo = res.data
				})
			},
			login() {
				uni.navigateTo({
					url: "/pages/login/login"
				})
			},
			jumpurl(url) {
				if (!httpRequest.checkIsLogin()) {
					uni.navigateTo({
						url: "/pages/login/login"
					})
					return false
				}
				uni.navigateTo({
					url
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.topbgc {
		background-image: url("@/static/images/system/mybgc.png");
		width: 100%;
		height: 400rpx;
		background-size: 100% 100%;
		position: fixed;
		top: 0;
		left: 0;
		z-index: -1;
	}

	.jfbgc {
		background-image: url("@/static/images/system/jfbgc.png");
		padding: 30rpx 50rpx;
		box-sizing: border-box;
		background-size: 100% 100%;
	}

	.chakan {
		padding: 15rpx 40rpx;
		border-radius: 50rpx;
		border: 1rpx solid #fff;
	}

	.lefticon {
		width: 40rpx;
		height: 40rpx;

	}

	.xiahuaxian {
		padding-bottom: 40rpx;
	}
</style>